package com.wj.blog.service.impl;

import com.wj.blog.mapper.UserMapper;
import com.wj.blog.pojo.User;
import com.wj.blog.service.AboutService;
import com.wj.blog.service.UserService;
import com.wj.blog.utils.Page;
import com.wj.blog.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Author:   wj
 * Date:     2020/4/9 15:20
 * Description:
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper mapper;
    @Override
    public User getByUsername(String username) {
        return mapper.getByUsername(username);
    }

    @Override
    public void save(User user) {
        mapper.save(user);
    }

    @Override
    public void delete(Integer id) {
        mapper.deleted(id);
    }

    @Override
    public void update(User user) {
        mapper.update(user);
    }

    @Override
    public void updateInfo(User user) {
        mapper.updateInfo(user);
    }

    @Override
    public Page<List<User>> getByPage(Page<User> user) {
        return mapper.getByPage(user);
    }

    @Override
    public User getById(Integer id) {
        return mapper.getById(id);
    }
}
